package general;

/**
 *
 * @author Kylan Robinson (krobinso@eecs.wsu.edu)
 */
public class Add extends Functional_Unit{
    
    //
    //default constructor
    //
    public Add () {
        setM(4);
        setDim(2);
        setNumRows(1);
        
        createCellfield();
        layout();
    }

    //
    //regular constructor
    //
    protected Add (int total_bits, int granularity, int cols_per_row) {
        setM(granularity);
        setDim(total_bits / granularity);
        setNumRows(total_bits / granularity / cols_per_row);
        
        createCellfield();
        layout();
    }
    
    //
    //establish the cell layout
    //
    @Override
    public void layout() {
        int i, j;
        
        //set up as an unsigned multipler
        //iterate over the rows
        for(i = 0; i < getNumRows(); i++) {
            //iterate over the columns
            for(j = 0; j < getDim(); j++) {
                //set the cell type
                cellfield[i][j].setType('+');
            }
        }
    }
    
    //
    //perform the multiplication
    //
    @Override
    public int compute() {
        return 0;
    }
}
